import matplotlib.pyplot as plt
import numpy as np

# 生成随机数据
data = np.random.randn(1000)

# 绘制直方图
plt.hist(data, bins=20, color='skyblue', alpha=0.7, edgecolor='black', linewidth=1)

# 设置标题和轴标签
plt.title('Histogram of Random Data')
plt.xlabel('Value')
plt.ylabel('Frequency')

# 显示图形
plt.show()
